home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / EnterAct 3.5 / Drag_on Modules / hAWK programs / $SortTest_Nums < prev    next >
Encoding:
Text File  |  1992-04-05  |  400 b   |  21 lines  |  [TEXT/KEEN]

  1. # $SortTest_Nums - test the builtin sort command
  2.  
  3.  
  4. BEGIN {    
  5.         for (i = 1; i <= 100; ++i)
  6.             a[i] = int(1000*rand())+1
  7.         for (i = 1; i <= 100;)
  8.             {
  9.             print a[i], a[i+1], a[i+2], a[i+3], a[i+4]
  10.             i += 5
  11.             }
  12.         max = sort(a,ind,"n");
  13.         print "now sorted:"
  14.         print "max is", max
  15.         for (i = 1; i <= 100;)
  16.             {
  17.             print a[ind[i]], a[ind[i+1]], a[ind[i+2]],
  18.              a[ind[i+3]], a[ind[i+4]]
  19.             i += 5
  20.             }
  21.     }